from django.db import models
from django.contrib.auth import get_user_model


class GameSave(models.Model):
    owner = models.OneToOneField(get_user_model(), on_delete=models.CASCADE, verbose_name='玩家',
                                 primary_key=True)
    data = models.TextField(verbose_name='数据')

    def __str__(self):
        return f'{self.owner}的存档'

    class Meta:
        verbose_name = '存档'
        verbose_name_plural = '存档'
        ordering = ('owner', )
